package pct.post;

import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import pct.database.PcServiceImpl;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

public class ReportBadInfo extends ActionSupport  implements SessionAware, Preparable {
	private  int postID;
	private int topicID;
	private String userID;
	private String messageType;
	private String groupName;
	private Map<String, Object> session;
	private PcServiceImpl pcService = new PcServiceImpl();
	
	public String execute(){
		if(messageType.equals("true"))			
			pcService.addReportMessage(postID, topicID, userID,true, groupName,new java.sql.Date(new java.util.Date().getTime()));
		return SUCCESS;
	}
	public String getGroupName() {
		return groupName;
	}
	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}
	public int getPostID() {
		return postID;
	}
	public void setPostID(int postID) {
		this.postID = postID;
	}
	public int getTopicID() {
		return topicID;
	}
	public void setTopicID(int topicID) {
		this.topicID = topicID;
	}
	public String getUserID() {
		return userID;
	}
	public void setUserID(String userID) {
		this.userID = userID;
	}
	public String getMessageType() {
		return messageType;
	}
	public void setMessageType(String messageType) {
		this.messageType = messageType;
	}
	@Override
	public void prepare() throws Exception {
		pcService.connectDB();
		
		
	}
	@Override
	public void setSession(Map<String, Object> arg0) {
		this.session = arg0;
		
	}
}
